home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
c
/
mc302emb.zip
/
LIBCF
/
RAND.ASM
< prev
next >
Wrap
Assembly Source File
|
1994-03-18
|
259b
|
12 lines
*
* Generate a pseudo-random number: int rand(limit)
*
rand LD RANDSEED Get current seed
MUL #13709 First calculation
ADD #13849 Second calculation
ST RANDSEED Resave seed
DIV 2,S Limit with division
ALT Get remainder
RET
$DD:RANDSEED 2